<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:t="https://code.google.com/p/rad-framework/taglib"
	xmlns:tt="https://code.google.com/p/rad-framework"
	xmlns:s="http://jboss.com/products/seam/taglib">
	
	<f:subview>
		<c:if test="#{value == null}">
			<t:fieldset legend="#{label}">
				<h:outputText value="#{messages['No']} #{label}"/>
			</t:fieldset>
		</c:if>
		
		<c:if test="#{value != null and t:rendered(value,id)}">
			
			<rich:togglePanel switchType="client"
				initialState="less" stateOrder="less,more">
				
				<f:facet name="less">
					<t:fieldset>
						<h:panelGrid columns="1" width="100%">
							<ui:include
								src="/#{viewPath == null ? 'jsf' : viewPath}/#{type}/ViewKeys.xhtml">
								<ui:param name="entity" value="#{value}"/>
								<ui:param name="label" value="#{label}"/>
							</ui:include>
							<rich:toggleControl
								value="#{messages['More']}"/>
						</h:panelGrid>
					</t:fieldset>
				</f:facet>
				
				<f:facet name="more">
					<t:fieldset>
						<h:panelGrid columns="1" width="100%">
							<ui:include
								src="/#{viewPath == null ? 'jsf' : viewPath}/#{type}/ViewPanel.xhtml">
								<ui:param name="entity" value="#{value}"/>
								<ui:param name="label" value="#{label}"/>
							</ui:include>
							<rich:toggleControl
								value="#{messages['Less']}"/>
						</h:panelGrid>
					</t:fieldset>
				</f:facet>
			</rich:togglePanel>
		</c:if>
	</f:subview>
	
</ui:composition>